import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
import _InputBase from "@mui/material/InputBase";
import React, { memo } from "react";
import styles from "./index.module.less";
import { useControllableValue } from "ahooks";
import { useTranslation } from "react-i18next";
import { LocalKeyMap } from "../../local";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var Component = function(props) {
    var t = useTranslation().t;
    var _props_placeholder = props.placeholder, placeholder = _props_placeholder === void 0 ? t(LocalKeyMap.search) : _props_placeholder, value = props.value, onChange = props.onChange, onConfirm = props.onConfirm, maxlength = props.maxlength, _props_type = props.type, type = _props_type === void 0 ? "text" : _props_type;
    var _useControllableValue = _sliced_to_array(useControllableValue(props, {
        defaultValue: ""
    }), 2), state = _useControllableValue[0], setState = _useControllableValue[1];
    return /*#__PURE__*/ _jsxs("div", {
        className: styles.page,
        children: [
            /*#__PURE__*/ _jsx("img", {
                src: require("../../assets/icons/search.svg"),
                className: styles.search
            }),
            /*#__PURE__*/ _jsx(_InputBase, {
                placeholder: placeholder,
                value: state,
                onChange: function(e) {
                    return setState(e.target.value);
                },
                type: type,
                className: styles.input
            })
        ]
    });
};
var Search = /*#__PURE__*/ memo(Component);
export default Search;

 //# sourceMappingURL=index.js.map